<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>

</body>
</html>

<script>
	var str ="When I was young, I love a girl in neighbor class."
	var start = str.indexOf("young");
	var end = str.indexOf("girl")+4;
	document.write(str.substring(start,end));
</script>